﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using The_Chronicles_of_Asku.Characters.Resources;

namespace The_Chronicles_of_Asku.Characters
{
    class Hero : Character
    {
        public int armor = 5;
        public int baseArmor = 5;
        public int health = 20;
        public int baseHealth = 20;
        public int xp = 0;
        public int level = 1;
        public int gold = 0;
        public int goldCap = 10000000;
        public int maxHealth = 20;
        public int baseMinHeal = 1;
        public int baseMaxHeal = 7;
        public int baseMinAttack =1;
        public int baseMaxAttack = 11;
        public int baseMinMagic = 1;
        public int baseMaxMagic = 11;
        public int minHeal = 1;
        public int maxHeal = 7;
        public int minAttack = 1;
        public int maxAttack = 11;
        public int minMagic = 1;
        public int maxMagic = 11;
        public int attackBonus = 0;
        public int healthBonus = 0;
        public int magicBonus = 0;
        public int healBonus = 0;
        public int armorBonus = 0;
        public bool isAlive = true;
        public int deathCount = 0;
        public bool hasFled = false;
        public int highestSurvival = 0;

        public string profession;

        public static void Initialize(Hero hero)
        {
            if (hero.Identifier == null || hero.Identifier == "" || hero.Identifier == " ")
            {
                Console.WriteLine(CharacterText.EnterCharacterName);
                hero.Identifier = Console.ReadLine();
                if (hero.Identifier == null || hero.Identifier == "" || hero.Identifier == " ")
                {
                    Console.WriteLine(CharacterText.EnterCharacterName);
                    hero.Identifier = Console.ReadLine();
                }
                Console.WriteLine();
                Console.WriteLine("Press Enter to continue...");
                Console.ReadLine();
                Console.Clear();
                Console.WriteLine("\t\t\tDark Tide Production presents...");
                Console.WriteLine("\t\t\tThe Chronicles of Asku...");
                Console.WriteLine();
                Console.WriteLine("Press Enter to continue...");
                Console.ReadLine();
                Console.Clear();
                Console.WriteLine(CharacterText.CharacterArrivesInTown, hero.Identifier);
                Console.WriteLine();
                Console.WriteLine("Press Enter to continue...");
                Console.ReadLine();
                Console.Clear();
            }
        }

        public Hero()
        {
            //To Do
        }

        public int getAttack(Hero myHero)
        {
            Random rand = new Random();
            int attack = 0;
            attack = rand.Next(minAttack, maxAttack);

            return attack;
        }

        public int getHeal(Hero myHero)
        {
            Random rand = new Random();
            int heal = 0;
            heal = rand.Next(minHeal, maxHeal);
            return heal;
        }

        public int getMagic(Hero myHero)
        {
            Random rand = new Random();
            int attack = 0;
            attack = rand.Next(minMagic, maxMagic);

            return attack;
        }

        public void ResetStats(Hero myHero)
        {
            health = maxHealth;
        }

        public void GetPlayerLevel(Hero myHero)
        {
            CalcHeroLevel calculate = new CalcHeroLevel();
            calculate.GetPlayerLevel(myHero);
        }

        public void DisplayStats(Hero myHero)
        {
            Console.WriteLine(@"
*************************************************************************
Name:           Level:          Health:           Attack Range:    
-------------------------------------------------------------------------
{0}             {1}             {2}               {3}-{4}
*************************************************************************
*************************************************************************
Magic Range:         Heal Range:          Armor:         Gold:      
-------------------------------------------------------------------------
{5}-{6}                  {7}-{8}              {9}             {10}
*************************************************************************
*************************************************************************
Magic Bonus:       Heal Bonus:          Armor Bonus:       Health Bonus:      
-------------------------------------------------------------------------
{11}                       {12}                  {13}             {14}
*************************************************************************
*************************************************************************
Attack Bonus:      Death Count:         Survival Count:
-------------------------------------------------------------------------
{15}                       {16}                   {17}
*************************************************************************", myHero.Identifier, myHero.level, myHero.health, myHero.minAttack, myHero.maxAttack, myHero.minMagic, myHero.maxMagic, myHero.minHeal, myHero.maxHeal, myHero.armor, myHero.gold, myHero.magicBonus, myHero.healBonus, myHero.armorBonus, myHero.healthBonus, myHero.attackBonus, myHero.deathCount, myHero.highestSurvival);

            Console.ReadKey();
            Console.Clear();
        }
    }
}
